<template>
	<view class="p20">
		<form-list ref="form" :list="list" />
		<view class="h120"></view>
		<u-button type="warning" ripple @click="submit">提交</u-button>
		<view class="tc mt20 color-999" @click="$u.route('/pages/public/forgetPwd')">忘记登录密码</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				list: [{
						name: '旧密码',
						type: 'password',
						field: 'old_password',
						rightIcon: false,
						required:true
					},
					{
						name: '新密码',
						type: 'password',
						field: 'password',
						rightIcon: false,
						required:true
					},
					{
						name: '确认新密码',
						placeholder:'请确认新密码',
						type: 'password',
						field: 'password2',
						rightIcon: false,
						required:true
					},
				]
			};
		},
		methods: {
			submit() {
				let form = this.$refs.form.submit()
				if(!form)return
				this.$request('/master/my/editPassword',form).then(res => {
					this.$msg(res.msg)
					this.$navBack(1, 1000)
				})
			}
		}
	}
</script>

<style lang="scss">

</style>
